package com.threadPool;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * Created by yijy on 2017/9/18.
 */
public class FixThreadPoolTest {
    public static void main(String[] args) {
        ExecutorService fixThreadPool = Executors.newFixedThreadPool(10);
        final int index=1;
        final int a=0;
        for(int i=0;i<20;i++){
            fixThreadPool.execute(new Runnable() {
                @Override
                public void run() {
                    try {
                        System.out.println(Thread.currentThread().getName()+":"+index);
                        Thread.sleep(200);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                }
            });
        }

    }
}
